using System;
using System.Collections.Generic;
using System.Linq;
using DataAccess.BusinessEntities;

namespace DataAccess.UnitTests
{
    public static class ProductObjectMother
    {
        public static IEnumerable<Product> CreateProducts()
        {
            yield return new Product()
            {
                Id = 18,
                Price = 6.95M,
                Container = ContainerObjectMother.CreateContainers().Where(c=>c.Id == 38).First(),
                ContainerId = ContainerObjectMother.CreateContainers().Where(c => c.Id == 38).First().Id,
                Substance = SubstanceObjectMother.CreateSubstances().Where(s => s.Id == 80024).First(),
                SubstanceId = SubstanceObjectMother.CreateSubstances().Where(s => s.Id == 80024).First().Id
            };

            yield return new Product()
            {
                Id = 26,
                Price = 6.95M,
                Container = ContainerObjectMother.CreateContainers().Where(c => c.Id == 1).First(),
                ContainerId = ContainerObjectMother.CreateContainers().Where(c => c.Id == 1).First().Id,
                Substance = SubstanceObjectMother.CreateSubstances().Where(s => s.Id == 81490).First(),
                SubstanceId = SubstanceObjectMother.CreateSubstances().Where(s => s.Id == 81490).First().Id
            };

            yield return new Product()
            {
                Id = 99,
                Price = 6.95M,
                Container = ContainerObjectMother.CreateContainers().Where(c => c.Id == 38).First(),
                ContainerId = ContainerObjectMother.CreateContainers().Where(c => c.Id == 38).First().Id,
                Substance = SubstanceObjectMother.CreateSubstances().Where(s => s.Id == 75218).First(),
                SubstanceId = SubstanceObjectMother.CreateSubstances().Where(s => s.Id == 75218).First().Id
            };

            yield return new Product()
            {
                Id = 100,
                Price = 6.95M,
                Container = ContainerObjectMother.CreateContainers().Where(c => c.Id == 38).First(),
                ContainerId = ContainerObjectMother.CreateContainers().Where(c => c.Id == 38).First().Id,
                Substance = SubstanceObjectMother.CreateSubstances().Where(s => s.Id == 81491).First(),
                SubstanceId = SubstanceObjectMother.CreateSubstances().Where(s => s.Id == 81491).First().Id
            };
        }
    }
}
